3.248 \(\int \sec ^2(c+d x) (a \sin (c+d x)+b \tan (c+d x))^3 \, dx\)

Optimal. Leaf size=111 \[ \frac {a^3 \cos (c+d x)}{d}+\frac {b \left (3 a^2-b^2\right ) \sec ^2(c+d x)}{2 d}+\frac {a \left (a^2-3 b^2\right ) \sec (c+d x)}{d}+\frac {3 a^2 b \log (\cos (c+d x))}{d}+\frac {a b^2 \sec ^3(c+d x)}{d}+\frac {b^3 \sec ^4(c+d x)}{4 d} \]

[Out]

a^3*cos(d*x+c)/d+3*a^2*b*ln(cos(d*x+c))/d+a*(a^2-3*b^2)*sec(d*x+c)/d+1/2*b*(3*a^2-b^2)*sec(d*x+c)^2/d+a*b^2*se
c(d*x+c)^3/d+1/4*b^3*sec(d*x+c)^4/d

________________________________________________________________________________________

Rubi [A]  time = 0.25, antiderivative size = 111, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {4397, 2837, 12, 894} \[ \frac {b \left (3 a^2-b^2\right ) \sec ^2(c+d x)}{2 d}+\frac {a \left (a^2-3 b^2\right ) \sec (c+d x)}{d}+\frac {3 a^2 b \log (\cos (c+d x))}{d}+\frac {a^3 \cos (c+d x)}{d}+\frac {a b^2 \sec ^3(c+d x)}{d}+\frac {b^3 \sec ^4(c+d x)}{4 d} \]

Antiderivative was successfully verified.

[In]

Int[Sec[c + d*x]^2*(a*Sin[c + d*x] + b*Tan[c + d*x])^3,x]

[Out]

(a^3*Cos[c + d*x])/d + (3*a^2*b*Log[Cos[c + d*x]])/d + (a*(a^2 - 3*b^2)*Sec[c + d*x])/d + (b*(3*a^2 - b^2)*Sec
[c + d*x]^2)/(2*d) + (a*b^2*Sec[c + d*x]^3)/d + (b^3*Sec[c + d*x]^4)/(4*d)

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 894

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIn
tegrand[(d + e*x)^m*(f + g*x)^n*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[e*f - d*g, 0] &&
NeQ[c*d^2 + a*e^2, 0] && IntegerQ[p] && ((EqQ[p, 1] && IntegersQ[m, n]) || (ILtQ[m, 0] && ILtQ[n, 0]))

Rule 2837

Int[cos[(e_.) + (f_.)*(x_)]^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + (f_.)
*(x_)])^(n_.), x_Symbol] :> Dist[1/(b^p*f), Subst[Int[(a + x)^m*(c + (d*x)/b)^n*(b^2 - x^2)^((p - 1)/2), x], x
, b*Sin[e + f*x]], x] /; FreeQ[{a, b, c, d, e, f, m, n}, x] && IntegerQ[(p - 1)/2] && NeQ[a^2 - b^2, 0]

Rule 4397

Int[u_, x_Symbol] :> Int[TrigSimplify[u], x] /; TrigSimplifyQ[u]

Rubi steps

\begin {align*} \int \sec ^2(c+d x) (a \sin (c+d x)+b \tan (c+d x))^3 \, dx &=\int (b+a \cos (c+d x))^3 \sec ^2(c+d x) \tan ^3(c+d x) \, dx\\ &=-\frac {\operatorname {Subst}\left (\int \frac {a^5 (b+x)^3 \left (a^2-x^2\right )}{x^5} \, dx,x,a \cos (c+d x)\right )}{a^3 d}\\ &=-\frac {a^2 \operatorname {Subst}\left (\int \frac {(b+x)^3 \left (a^2-x^2\right )}{x^5} \, dx,x,a \cos (c+d x)\right )}{d}\\ &=-\frac {a^2 \operatorname {Subst}\left (\int \left (-1+\frac {a^2 b^3}{x^5}+\frac {3 a^2 b^2}{x^4}+\frac {3 a^2 b-b^3}{x^3}+\frac {a^2-3 b^2}{x^2}-\frac {3 b}{x}\right ) \, dx,x,a \cos (c+d x)\right )}{d}\\ &=\frac {a^3 \cos (c+d x)}{d}+\frac {3 a^2 b \log (\cos (c+d x))}{d}+\frac {a \left (a^2-3 b^2\right ) \sec (c+d x)}{d}+\frac {b \left (3 a^2-b^2\right ) \sec ^2(c+d x)}{2 d}+\frac {a b^2 \sec ^3(c+d x)}{d}+\frac {b^3 \sec ^4(c+d x)}{4 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 1.90, size = 97, normalized size = 0.87 \[ \frac {4 a^3 \cos (c+d x)+\left (6 a^2 b-2 b^3\right ) \sec ^2(c+d x)+4 a \left (a^2-3 b^2\right ) \sec (c+d x)+12 a^2 b \log (\cos (c+d x))+4 a b^2 \sec ^3(c+d x)+b^3 \sec ^4(c+d x)}{4 d} \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[c + d*x]^2*(a*Sin[c + d*x] + b*Tan[c + d*x])^3,x]

[Out]

(4*a^3*Cos[c + d*x] + 12*a^2*b*Log[Cos[c + d*x]] + 4*a*(a^2 - 3*b^2)*Sec[c + d*x] + (6*a^2*b - 2*b^3)*Sec[c +
d*x]^2 + 4*a*b^2*Sec[c + d*x]^3 + b^3*Sec[c + d*x]^4)/(4*d)

________________________________________________________________________________________

fricas [A]  time = 0.61, size = 107, normalized size = 0.96 \[ \frac {4 \, a^{3} \cos \left (d x + c\right )^{5} + 12 \, a^{2} b \cos \left (d x + c\right )^{4} \log \left (-\cos \left (d x + c\right )\right ) + 4 \, a b^{2} \cos \left (d x + c\right ) + 4 \, {\left (a^{3} - 3 \, a b^{2}\right )} \cos \left (d x + c\right )^{3} + b^{3} + 2 \, {\left (3 \, a^{2} b - b^{3}\right )} \cos \left (d x + c\right )^{2}}{4 \, d \cos \left (d x + c\right )^{4}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^2*(a*sin(d*x+c)+b*tan(d*x+c))^3,x, algorithm="fricas")

[Out]

1/4*(4*a^3*cos(d*x + c)^5 + 12*a^2*b*cos(d*x + c)^4*log(-cos(d*x + c)) + 4*a*b^2*cos(d*x + c) + 4*(a^3 - 3*a*b
^2)*cos(d*x + c)^3 + b^3 + 2*(3*a^2*b - b^3)*cos(d*x + c)^2)/(d*cos(d*x + c)^4)

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: TypeError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^2*(a*sin(d*x+c)+b*tan(d*x+c))^3,x, algorithm="giac")

[Out]

Exception raised: TypeError >> An error occurred running a Giac command:INPUT:sage2:=int(sage0,x):;OUTPUT:Modg
cd: no suitable evaluation pointindex.cc index_m operator + Error: Bad Argument ValueUnable to check sign: (2*
pi/t_nostep/2)>(-2*pi/t_nostep/2)Unable to check sign: (2*pi/t_nostep/2)>(-2*pi/t_nostep/2)Unable to check sig
n: (2*pi/t_nostep/2)>(-2*pi/t_nostep/2)Unable to check sign: (2*pi/t_nostep/2)>(-2*pi/t_nostep/2)Unable to che
ck sign: (2*pi/t_nostep/2)>(-2*pi/t_nostep/2)Unable to check sign: (2*pi/t_nostep/2)>(-2*pi/t_nostep/2)Unable
to check sign: (2*pi/t_nostep/2)>(-2*pi/t_nostep/2)Unable to check sign: (2*pi/t_nostep/2)>(-2*pi/t_nostep/2)U
nable to check sign: (2*pi/t_nostep/2)>(-2*pi/t_nostep/2)Unable to check sign: (2*pi/t_nostep/2)>(-2*pi/t_nost
ep/2)Unable to check sign: (2*pi/t_nostep/2)>(-2*pi/t_nostep/2)Unable to check sign: (2*pi/t_nostep/2)>(-2*pi/
t_nostep/2)Unable to check sign: (2*pi/t_nostep/2)>(-2*pi/t_nostep/2)Unable to check sign: (2*pi/t_nostep/2)>(
-2*pi/t_nostep/2)Unable to check sign: (2*pi/t_nostep/2)>(-2*pi/t_nostep/2)Unable to check sign: (2*pi/t_noste
p/2)>(-2*pi/t_nostep/2)Unable to check sign: (2*pi/t_nostep/2)>(-2*pi/t_nostep/2)Unable to check sign: (2*pi/t
_nostep/2)>(-2*pi/t_nostep/2)Unable to check sign: (2*pi/t_nostep/2)>(-2*pi/t_nostep/2)Unable to check sign: (
2*pi/t_nostep/2)>(-2*pi/t_nostep/2)Unable to check sign: (2*pi/t_nostep/2)>(-2*pi/t_nostep/2)Unable to check s
ign: (2*pi/t_nostep/2)>(-2*pi/t_nostep/2)Unable to check sign: (2*pi/t_nostep/2)>(-2*pi/t_nostep/2)Unable to c
heck sign: (2*pi/t_nostep/2)>(-2*pi/t_nostep/2)Evaluation time: 76.28Done

________________________________________________________________________________________

maple [A]  time = 0.14, size = 204, normalized size = 1.84 \[ \frac {a^{3} \left (\sin ^{4}\left (d x +c \right )\right )}{d \cos \left (d x +c \right )}+\frac {\cos \left (d x +c \right ) \left (\sin ^{2}\left (d x +c \right )\right ) a^{3}}{d}+\frac {2 a^{3} \cos \left (d x +c \right )}{d}+\frac {3 a^{2} b \left (\tan ^{2}\left (d x +c \right )\right )}{2 d}+\frac {3 a^{2} b \ln \left (\cos \left (d x +c \right )\right )}{d}+\frac {a \,b^{2} \left (\sin ^{4}\left (d x +c \right )\right )}{d \cos \left (d x +c \right )^{3}}-\frac {a \,b^{2} \left (\sin ^{4}\left (d x +c \right )\right )}{d \cos \left (d x +c \right )}-\frac {\cos \left (d x +c \right ) \left (\sin ^{2}\left (d x +c \right )\right ) a \,b^{2}}{d}-\frac {2 a \,b^{2} \cos \left (d x +c \right )}{d}+\frac {b^{3} \left (\sin ^{4}\left (d x +c \right )\right )}{4 d \cos \left (d x +c \right )^{4}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(d*x+c)^2*(a*sin(d*x+c)+b*tan(d*x+c))^3,x)

[Out]

1/d*a^3*sin(d*x+c)^4/cos(d*x+c)+1/d*cos(d*x+c)*sin(d*x+c)^2*a^3+2*a^3*cos(d*x+c)/d+3/2*a^2*b*tan(d*x+c)^2/d+3*
a^2*b*ln(cos(d*x+c))/d+1/d*a*b^2*sin(d*x+c)^4/cos(d*x+c)^3-1/d*a*b^2*sin(d*x+c)^4/cos(d*x+c)-1/d*cos(d*x+c)*si
n(d*x+c)^2*a*b^2-2*a*b^2*cos(d*x+c)/d+1/4/d*b^3*sin(d*x+c)^4/cos(d*x+c)^4

________________________________________________________________________________________

maxima [A]  time = 0.36, size = 96, normalized size = 0.86 \[ \frac {b^{3} \tan \left (d x + c\right )^{4} - 6 \, a^{2} b {\left (\frac {1}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right )^{2} - 1\right )\right )} + 4 \, a^{3} {\left (\frac {1}{\cos \left (d x + c\right )} + \cos \left (d x + c\right )\right )} - \frac {4 \, {\left (3 \, \cos \left (d x + c\right )^{2} - 1\right )} a b^{2}}{\cos \left (d x + c\right )^{3}}}{4 \, d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^2*(a*sin(d*x+c)+b*tan(d*x+c))^3,x, algorithm="maxima")

[Out]

1/4*(b^3*tan(d*x + c)^4 - 6*a^2*b*(1/(sin(d*x + c)^2 - 1) - log(sin(d*x + c)^2 - 1)) + 4*a^3*(1/cos(d*x + c) +
 cos(d*x + c)) - 4*(3*cos(d*x + c)^2 - 1)*a*b^2/cos(d*x + c)^3)/d

________________________________________________________________________________________

mupad [B]  time = 4.22, size = 223, normalized size = 2.01 \[ \frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (-12\,a^3+6\,a^2\,b+12\,a\,b^2\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (12\,a^3-6\,a^2\,b+4\,a\,b^2+4\,b^3\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (4\,a^3+6\,a^2\,b+12\,a\,b^2-4\,b^3\right )-4\,a\,b^2+4\,a^3+6\,a^2\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}-3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}-\frac {6\,a^2\,b\,\mathrm {atanh}\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a*sin(c + d*x) + b*tan(c + d*x))^3/cos(c + d*x)^2,x)

[Out]

(tan(c/2 + (d*x)/2)^2*(12*a*b^2 + 6*a^2*b - 12*a^3) + tan(c/2 + (d*x)/2)^4*(4*a*b^2 - 6*a^2*b + 12*a^3 + 4*b^3
) - tan(c/2 + (d*x)/2)^6*(12*a*b^2 + 6*a^2*b + 4*a^3 - 4*b^3) - 4*a*b^2 + 4*a^3 + 6*a^2*b*tan(c/2 + (d*x)/2)^8
)/(d*(2*tan(c/2 + (d*x)/2)^4 - 3*tan(c/2 + (d*x)/2)^2 + 2*tan(c/2 + (d*x)/2)^6 - 3*tan(c/2 + (d*x)/2)^8 + tan(
c/2 + (d*x)/2)^10 + 1)) - (6*a^2*b*atanh(tan(c/2 + (d*x)/2)^2))/d

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a \sin {\left (c + d x \right )} + b \tan {\left (c + d x \right )}\right )^{3} \sec ^{2}{\left (c + d x \right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)**2*(a*sin(d*x+c)+b*tan(d*x+c))**3,x)

[Out]

Integral((a*sin(c + d*x) + b*tan(c + d*x))**3*sec(c + d*x)**2, x)

________________________________________________________________________________________